Skip to main content

API v2.0

Cyberhaven API v2.0 is the modern OpenAPI implementation for platform configuration and data querying. Use these endpoints to integrate with SIEMs, SOAR, ticketing, and asset management tools.

Base URL

https://<tenant-name>.cyberhaven.io/v2/

Request Methods

The API supports multiple request methods for different use cases:

MethodUse CaseDescription
GETSimple queriesBasic requests with few parameters via query string
POSTComplex queriesRecommended for requests with filtering, pagination, or large parameter sets
PATCHUpdatesPartial updates to existing resources
DELETERemovalRemove resources from management

Request Method Examples

GET with Query Parameters

GET /v2/event-details?ids=event1,event2&include_content=true

GET with Path Parameters

GET /v2/installer/windows/latest

POST with Request Body (Recommended)

POST /v2/incidents/list
{
"filter": {
"policy_severities": ["high", "critical"]
},
"page_request": {
"size": 50
}
}

Data Types

Primitive Types

TypeDescriptionExample
stringText value"example-value"
integerWhole number42
booleanTrue/false valuetrue
numberDecimal number3.14

Complex Types

TypeDescriptionExample
array[string]List of text values["item1", "item2", "item3"]
array[object]List of objects[{"id": "1"}, {"id": "2"}]
objectStructured data{"field": "value", "count": 10}

Time Formats

FormatDescriptionExample
ISO 8601Standard timestamp format"2024-01-15T10:30:00Z"
DurationTime duration"30s", "5m", "1h"

Response Headers

Standard response headers included with API responses:

HeaderDescriptionExample
Content-TypeResponse formatapplication/json
Content-LengthResponse size in bytes1024
X-RateLimit-RemainingRequests remaining in current window45
X-RateLimit-ResetTime when rate limit resets1642248600

Binary Response Headers

For file downloads (e.g., installers):

HeaderDescriptionExample
Content-TypeBinary content typeapplication/octet-stream
Content-DispositionDownload filenameattachment; filename="installer.msi"
X-Installer-VersionSoftware version24.03.90.366

Response Objects

Standard Response Structure

FieldTypeDescription
typestringResource type identifier
sizeintegerNumber of items returned
resourcesarrayArray of resource objects
errorsarray[Error]Any errors encountered

Error Object Structure

FieldTypeDescription
codestringError code identifier
messagestringHuman-readable error description
detailsobjectAdditional error context

Example Response

{
"type": "events",
"size": 2,
"resources": [
{
"id": "event-123",
"timestamp": "2024-01-15T10:30:00Z"
}
],
"errors": []
}

Pagination Controls

Page Request Object

FieldTypeRequiredDescription
sizeintegerNoNumber of results per page (max 1000, default 50)
idstringNoPage token for next page (from previous response)
sort_bystringNoSort field and direction

Page Response Object

FieldTypeDescription
next_idstringToken for retrieving next page
totalintegerTotal number of matched resources

Sort Options

FormatDescriptionExample
field ascAscending order"hostname asc"
field descDescending order"timestamp desc"

Pagination Example

{
"page_request": {
"size": 100,
"sort_by": "timestamp desc"
}
}

Status Codes

Success Codes

CodeStatusDescription
200OKRequest successful
201CreatedResource created successfully
204No ContentRequest successful, no response body

Client Error Codes

CodeStatusDescription
400Bad RequestInvalid request parameters or format
401UnauthorizedInvalid or expired access token
403ForbiddenInsufficient permissions for operation
404Not FoundRequested resource not found
409ConflictResource conflict (e.g., duplicate name)
429Too Many RequestsRate limit exceeded

Server Error Codes

CodeStatusDescription
500Internal Server ErrorPlatform issue, contact support
502Bad GatewayTemporary service unavailability
503Service UnavailablePlanned maintenance or overload

Rate Limiting

Standard Limits

Limit TypeValueDescription
Requests per minute60Maximum requests per API key per minute
Concurrent requests5Maximum simultaneous requests per endpoint
Response on limit429HTTP status code when limits exceeded

Rate Limit Headers

HeaderDescription
X-RateLimit-RemainingRequests remaining in current window
X-RateLimit-ResetUnix timestamp when limit resets

Authentication

All API calls require Bearer token authentication:

Authorization: Bearer <access-token>

See Authentication Guide for token generation details.